﻿using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace DxfMonitor.Data
{
    public class DxfDbContext : DbContext
    {


        public DxfDbContext() : this(new DbContextOptionsBuilder<DxfDbContext>()
                   .UseSqlite(new SqliteConnection(Constants.connectionString)).Options)
        {

        }
        public DxfDbContext(DbContextOptions<DxfDbContext> options) : base(options)
        {
        }
        public DbSet<DxfFile> DxfFiles { get; set; }
        public DbSet<DxfFolder> DxfFolders { get; set; }
        public DbSet<DxfPair> DxfPairs { get; set; }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
            builder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
        }
    }
}
